<template>
  <Header title="提交成功" :sub="$route.params.msg"/>
  <el-card :body-style="{ padding: '0px' }" style="margin-top: 10px">
    <el-image :src="imgUrl" style="margin-top: 15px; width: 400px; height: 200px" :v-loading="loading" :load="() => {this.loading = false}"/>
    <div style="padding: 14px">
      <p>每日一图送给你</p>
      <span>希望你保持好心情哦~</span>
    </div>
  </el-card>
</template>

<script>
import Header from "@/components/Header";
import {ElNotification} from "element-plus";

const successNotification = (msg) => {
  ElNotification({
    title: '提交成功！',
    message: msg,
    type: 'success',
    duration: 0
  })
}

export default {
  name: "Result_Main",
  data() {
    return {
      imgUrl: '',
      loading: true,
    }
  },
  components: {
    Header,
  },
  created() {
    let date = new Date();
    let year = date.getFullYear()
    let month = date.getMonth() + 1
    let day = date.getDate()
    this.imgUrl = "https://bing.creepersan.com/bing-image/" + year.toString() + "/"
    + (month < 10 ? "0" + month.toString() : month.toString()) + "/"
    + (day < 10 ? "0" + day.toString() : day.toString()) + "/400x240.jpg";
    document.title = "提交结果"
    successNotification(this.$route.params.msg)
  }
}
</script>

<style scoped>

</style>